package com.snail.server.order.controller;

import com.snail.server.order.manager.PayManager;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 *
 * @author zz
 * @since 2023-10-26
 */
@Api(tags = {"支付"})
@RestController
@RequestMapping("/pay")
public class PayOrderController {

    @Resource
    PayManager payManager;

    @PostMapping
    public String pay() {
        return payManager.pay();
    }

    @GetMapping("/{payOrderId}")
    public String pay(@PathVariable("payOrderId") String payOrderId) {
        return payManager.queryByPayOrderId();
    }

    @PostMapping("/refund")
    public String refund() {
        return payManager.refund();
    }

    @GetMapping("/refund/{refundOrderId}")
    public String refund(@PathVariable("refundOrderId") String refundOrderId) {
        return payManager.queryByRefundOrderId();
    }

}